package com.wlc.config.rabbitconfirm;

import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @author 王立朝
 * @description 消息发送交换机返回机制
 * @date 2021-12-15 10:33:47
 */
public class RabbitConfirmReturnCallBack implements RabbitTemplate.ReturnsCallback {


    /**
     * Returned message callback.
     *
     * @param returned the returned message and metadata.
     */
    @Override
    public void returnedMessage(ReturnedMessage returned) {
        System.out.println("--------ReturnMessage------start");
        System.out.println("returned.getMessage() = " + returned.getMessage());
        System.out.println("returned.getExchange() = " + returned.getExchange());
        System.out.println("returned.getReplyCode() = " + returned.getReplyCode());
        System.out.println("returned.getReplyText() = " + returned.getReplyText());
        System.out.println("returned.getRoutingKey() = " + returned.getRoutingKey());


        System.out.println("--------ReturnMessage------end");
    }
}
